﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.models {
    import flash.events.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class GameStateModel extends Actor {

        private var m_state:int;
        private var m_previousState:int;
        private var m_isFacadeVisible:Boolean;
        private var m_isBuildMode:Boolean;// = false
        private var _isFirstComplete:Boolean = true
        private var _initWorldComplete:Boolean;// = false

        public static const STATE_GAME_PREPARE:int = 10;
        public static const STATE_GAME_TUTORIAL:int = 20;
        public static const STATE_GAME_RUNNING:int = 30;

        public function GameStateModel(){
            this.m_state = GameStateModel.STATE_GAME_PREPARE;
            this.m_isFacadeVisible = false;
        }
        public function set state(_arg1:int):void{
            l(("i state: " + _arg1));
            this.m_previousState = this.m_state;
            this.m_state = _arg1;
            dispatch(new GameEvent(GameEvent.GAMESTATE_CHANGE));
        }
        public function get state():int{
            return (this.m_state);
        }
        public function get previousState():int{
            return (this.m_previousState);
        }
        public function get isFacadeVisible():Boolean{
            return (this.m_isFacadeVisible);
        }
        public function set isFacadeVisible(_arg1:Boolean):void{
            if (_arg1 != this.m_isFacadeVisible){
                this.m_isFacadeVisible = _arg1;
                dispatch(new BuildingEvent(BuildingEvent.FACADE_CHANGED));
                dispatch(new Event(EventConstants.UPDATE_BUILD_MODE));
            };
        }
        public function get isBuildMode():Boolean{
            return (this.m_isBuildMode);
        }
        public function set isBuildMode(_arg1:Boolean):void{
            this.m_isBuildMode = _arg1;
            dispatch(new Event(EventConstants.UPDATE_BUILD_MODE));
        }
        public function get isFirstComplete():Boolean{
            return (this._isFirstComplete);
        }
        public function set isFirstComplete(_arg1:Boolean):void{
            this._isFirstComplete = _arg1;
        }
        public function get isRunning():Boolean{
            return ((this.m_state == STATE_GAME_RUNNING));
        }
        public function get initWorldComplete():Boolean{
            return (this._initWorldComplete);
        }
        public function set initWorldComplete(_arg1:Boolean):void{
            this._initWorldComplete = _arg1;
        }

    }
}//package net.wooga.pets.models 
